package com.qdlc.p2p.manage.common.freemarker;

import javax.servlet.ServletContext;

import com.qdlc.p2p.biz.freemarker.CustomFreemarkerManager;
import com.qdlc.p2p.common.util.FreemarkerUtil;
import com.qdlc.p2p.manage.common.freemarker.directive.AuthorizeUrlDirectiveModel;

import freemarker.template.Configuration;
import freemarker.template.TemplateException;

public class ManagerCustomFreemarker extends CustomFreemarkerManager {

	@Override
	protected Configuration createConfiguration(ServletContext servletContext) throws TemplateException {
		Configuration cfg = super.createConfiguration(servletContext);
		cfg.setSharedVariable("secAuthorizeUrl", new AuthorizeUrlDirectiveModel());
		FreemarkerUtil.CONFIG = cfg;
		return cfg;
	}
}
